home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / Warp3D / Install_Warp3D < prev    next >
Text File  |  1999-02-06  |  10KB  |  426 lines

  1. ; $VER: Installation script for Warp3D 1.0 ( 5. Dezember 1998)
  2. ; © Thomas & Hans-Jörg Frieden
  3. ; Created with GoldED 5.0
  4. ; Adapted for V2 beta, 04-Feb-99
  5. ; check if we are running under correct OS
  6.  
  7. (if (< (/ (getversion) 65536) 39)
  8.     (
  9.         (abort "Incorrect OS version (software requires OS 39 or better )!")
  10.     )
  11. )
  12.  
  13. ; error handling
  14.  
  15. ;
  16. ; Procedure to copy a single library
  17. (procedure P_copy_single arg1 arg2 arg3
  18.         (copylib
  19.                 (confirm)
  20.                 (prompt arg3)
  21.                 (help @copylib-help)
  22.                 (source arg1)
  23.                 (dest arg2)
  24.                 (optional "oknodelete" "askuser")
  25.         )
  26. )
  27.  
  28. ;
  29. ; How can it be there's no way of specifying an environment variable?
  30. (procedure P_setenv arg1 arg2
  31.         (
  32.                 (if (exists (tackon "ENV:" arg1) (noreq))
  33.                         (delete (tackon "ENV:" arg1))
  34.                 )
  35.                 (if (exists (tackon "ENVARC:" arg1) (noreq))
  36.                         (delete (tackon "ENVARC:" arg1))
  37.                 )
  38.                 (textfile
  39.                         (dest (tackon "ENV:" arg1))
  40.                         (append arg2)
  41.                 )
  42.                 (textfile
  43.                         (dest (tackon "ENVARC:" arg1))
  44.                         (append arg2)
  45.                 )
  46.         )
  47. )
  48.  
  49. ;
  50. ; Procedure to invalidate old version
  51. (procedure P_invalidate
  52.     (if (exists "libs:Warp3D" (noreq))
  53.       ( if (< (getversion "libs:Warp3D.library") 131072)
  54.         (
  55.         (message (cat "The installer will now invalidate your old installation by moving "
  56.                       "old files to a directory old_warp3d. Note that the old libraries "
  57.                       "are no longer compatible with V2")
  58.         )
  59.         ; make backup directory
  60.         (makedir "libs:old_warp3d")
  61.         (makedir "libs:old_warp3d/Warp3D")
  62.  
  63.         ; copy old stuff
  64.         (copyfiles
  65.             (source "Libs:Warp3D")
  66.             (dest "Libs:old_warp3d/Warp3D")
  67.             (infos)
  68.             (all)
  69.             (optional "nofail" "force" "askuser")
  70.         )
  71.         (copyfiles
  72.             (source "Libs:Warp3D.library")
  73.             (dest "Libs:old_warp3d")
  74.             (infos)
  75.             (all)
  76.             (optional "nofail" "force" "askuser")
  77.         )
  78.         (copyfiles
  79.             (source "Libs:Warp3DPPC.library")
  80.             (dest "Libs:old_warp3d")
  81.             (infos)
  82.             (all)
  83.             (optional "nofail" "force" "askuser")
  84.         )
  85.  
  86.         ; delete old files
  87.         (delete "libs:Warp3D.library" (optional "force"))
  88.         (delete "libs:Warp3DPPC.library" (optional "force"))
  89.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  90.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  91.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  92.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  93.         (delete "libs:Warp3D/" (optional "force"))
  94.  
  95.         (message (cat "The old libraries can now be found in libs:old_warp3d."
  96.                       "If you experience any problem with V2, you may uninstall it "
  97.                       "and use the old_warp3d files again. Otherwise, you may delete "
  98.                       "the old_warp3d directory")
  99.         )
  100.       )
  101.     )
  102.     )
  103. )
  104.  
  105.  
  106.  
  107.  
  108. (onerror
  109.     (if (> @ioerr 0)
  110.         (
  111.             (message
  112.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  113.             )
  114.         )
  115.     )
  116.     (exit (quiet))
  117. )
  118.  
  119. (set #installmode
  120.     (askbool
  121.         (prompt "Choose the installation mode:")
  122.         (help "Select Install if you want to install Warp3D, and Uninstall if you want to remove it. Warp3D is a hardware independent driver system for 3d accelerators.")
  123.         (choices
  124.             "Install"
  125.             "Uninstall"
  126.         )
  127.         (default 1)
  128.     )
  129. )
  130.  
  131. (if (= #installmode 1)
  132.     ; normal installation
  133.     (
  134.         (welcome (cat
  135.             "Welcome to the Warp3D installation. This utility will install or "
  136.             "update Warp3D, the hardware-independent 3D driver system, on your "
  137.             "Amiga. ")
  138.         )
  139.         (P_invalidate)
  140.  
  141.         (message "The Installation program will now create a new directory \"Warp3D\" in your LIBS directory where the Warp3D libraries will be installed.")
  142.         (makedir "Libs:Warp3D/")
  143.         (makedir "Libs:Warp3D/GFXdrivers")
  144.         (makedir "Libs:Warp3D/HWdrivers")
  145.         ; --- Try to find out if WarpUp is installed.
  146.         (if (exists "libs:Warp.library" (noreq))
  147.             (set #ppc 1)
  148.             (set #pcc 0)
  149.         )
  150.         (if (= #ppc 1)
  151.             (set #result
  152.                 (askbool
  153.                     (prompt "You seem to have WarpUp installed. Warp3D comes with a special PPC version that is usable for WarpUp applications. Do you want to install the PPC libraries, too?")
  154.                     (help @askbool-help)
  155.                     (choices "Yes" "No")
  156.                     (default 1)
  157.                 )
  158.             )
  159.             (if (= #result 0)
  160.                 (set #ppc 0)
  161.             )
  162.         )
  163.         (copylib
  164.             (prompt "Copying the master library")
  165.             (help @copylib-help)
  166.             (source "libs/Warp3D.library")
  167.             (dest "libs:")
  168.         )
  169.         (if (= #ppc 1)
  170.             (copylib
  171.                 (prompt "Copying the PPC master library")
  172.                 (help @copylib-help)
  173.                 (source "libs/Warp3DPPC.library")
  174.                 (dest "libs:")
  175.             )
  176.         )
  177.  
  178.         ; ask for graphics driver
  179.         (set #gfx_sys
  180.             (askoptions
  181.                 (prompt "Which graphics systems do you want to install ?")
  182.                 (help @askoptions-help)
  183.                 (choices
  184.                     "CyberGraphX V3/V4"
  185.                     "Picasso96"
  186.                 )
  187.                 (default (+ 1 2))
  188.             )
  189.         )
  190.  
  191.         ; if P96 is selected, install it
  192.         (if (BITAND #gfx_sys 2)
  193.          (
  194.             (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96.library"
  195.                            "libs:Warp3D/GFXdrivers"
  196.                            "Copy Picasso96 driver"
  197.             )
  198.             (if (= #ppc 1)
  199.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96_PPC.library"
  200.                                "libs:Warp3D/GFXdrivers"
  201.                                "Copy Picasso96 driver (PPC version)"
  202.                 )
  203.             )
  204.          )
  205.         )
  206.  
  207.         ; same for CGX, but ask for version first
  208.         (if (BITAND #gfx_sys 1)
  209.         (
  210.             (set #result
  211.                 (askchoice
  212.                     (prompt (cat "What version of CyberGraphX do you want to install ?\n"
  213.                                  "Note that the V3 driver works on V4, but will give only "
  214.                                  "1 MB (0.5 on Z2) for textures. Also note that the V4 driver "
  215.                                  "needs the BITMAPCACHE=YES tooltype in your monitor file.\n"
  216.                                  "For the Permedia driver, the V4 driver is needed. \n"
  217.                                  "For the Virge driver, you would be better off with the V3 driver "
  218.                                  "(This is still beta, after all)")
  219.                     )
  220.                     (help @askchoice-help)
  221.                     (choices
  222.                         "CyberGraphX V3 (for CyberVision3D)"
  223.                         "CyberGraphX V3 (for CVPPC/BVPPC)"
  224.                         "CyberGraphX V4"
  225.                     )
  226.                     (default 0)
  227.                 )
  228.             )
  229.             ; assume the V4 driver will be installed, except when CVision3D is selected
  230.             (set #version 1)
  231.             (if (= #result 0)
  232.                 (set #version 0)
  233.             )
  234.  
  235.             (if (= #version 0)
  236.             (
  237.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX.library"
  238.                                "libs:Warp3D/GFXdrivers"
  239.                                "Copy CyberGraphX V3 driver"
  240.                 )
  241.                 (if (= #ppc 1)
  242.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX_PPC.library"
  243.                                    "libs:Warp3D/GFXdrivers"
  244.                                    "Copy CyberGraphX V3 driver (PPC version)"
  245.                     )
  246.                 )
  247.              )
  248.              (
  249.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4.library"
  250.                                "libs:Warp3D/GFXdrivers"
  251.                                "Copy CyberGraphX V4 driver"
  252.                 )
  253.                 (if (= #ppc 1)
  254.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4_PPC.library"
  255.                                    "libs:Warp3D/GFXdrivers"
  256.                                    "Copy CyberGraphX V4 driver (PPC version)"
  257.                     )
  258.                 )
  259.              )
  260.             )
  261.          )
  262.         )
  263.  
  264.         ; Try to find out the graphics card, assuming CVision3D
  265.         (set #graka 0)
  266.         (if (exists "devs:Monitors/CVision3D" (noreq))
  267.             (set #graka 0)
  268.         )
  269.         (if (exists "devs:Monitors/CVisionPPC" (noreq))
  270.             (set #graka 1)
  271.         )
  272.  
  273.         ; Ask for graphics card
  274.         (set #result
  275.             (askchoice
  276.                 (prompt "Please select the graphics device you want to use.")
  277.                 (help @askchoice-help)
  278.                 (choices
  279.                     "CyberVision64/3D"
  280.                     "CyberVisionPPC/BlizzardVisionPPC"
  281.                 )
  282.                 (default #graka)
  283.             )
  284.         )
  285.         (select #result
  286.             (
  287.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Virge.library")
  288.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Virge_PPC.library")
  289.             )
  290.             (
  291.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Permedia2.library")
  292.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Permedia2_PPC.library")
  293.             )
  294.         )
  295.         (copylib
  296.             (prompt "Copying the hardware driver library")
  297.             (help @copylib-help)
  298.             (source #grdrv)
  299.             (dest "libs:Warp3D/HWdrivers")
  300.         )
  301.         (if (= #ppc 1)
  302.             (copylib
  303.                 (prompt "Copying the PPC hardware driver library")
  304.                 (help @copylib-help)
  305.                 (source #grdrv2)
  306.                 (dest "libs:Warp3D/HWdrivers")
  307.             )
  308.  
  309.         )
  310.         (if (= #result 1)
  311.          (
  312.             ; Take special steps for Permedia driver
  313.             (makedir "ENV:Warp3D")
  314.             (makedir "ENV:Warp3D/Permedia2")
  315.             (makedir "ENVARC:Warp3D")
  316.             (makedir "ENVARC:Warp3D/Permedia2")
  317.             (P_setenv "Warp3D/Permedia2/Dither" "on")
  318.             (set #result
  319.                 (askbool
  320.                     (prompt (cat "For the Permedia2 driver to work correctly, semaphore "
  321.                                  "locking is required. This is done by setting the environment "
  322.                                  "variable CyberGraphX/USESEMAPHORES to 1. See the documentation for more details. "
  323.                                  "Should the installer program do this now ?")
  324.                     )
  325.                     (help @askbool-help)
  326.                     (choices
  327.                         "Yes"
  328.                         "No"
  329.                     )
  330.                     (default 1)
  331.                 )
  332.             )
  333.             (if (= #result 1)
  334.                 (P_setenv "CyberGraphX/USESEMAPHORES" "1" )
  335.                 (message "Ok, but remember that you may run into troubles later!")
  336.             )
  337.  
  338.          )
  339.         )
  340.         ; Ask for demo installation
  341.         (set #result
  342.             (askbool
  343.                 (prompt "Do you want to install the demo?")
  344.                 (help @askbool-help)
  345.                 (choices
  346.                     "Yes"
  347.                     "No"
  348.                 )
  349.                 (default 1)
  350.             )
  351.         )
  352.         (if (= #result 1) (
  353.                 (set #demodest
  354.                     (askdir
  355.                         (prompt "Select a location to install the Demo. A Drawer \"W3DDemo\" will be created")
  356.                         (help @askdir-help)
  357.                         (newpath)
  358.                         (default "ram:")
  359.                     )
  360.                 )
  361.                 (if (NOT (exists #demodest))
  362.                     (makedir #demodest)
  363.                 )
  364.                 (copyfiles
  365.                     (source "demo/")
  366.                     (dest (tackon #demodest "W3DDemo"))
  367.                     (infos)
  368.                     (all)
  369.                     (optional "oknodelete" "force" "askuser")
  370.                 )
  371.             )
  372.         )
  373.         (set #result
  374.             (askbool
  375.                 (prompt "Do you want to Install the User's Guide?")
  376.                 (help @askbool-help)
  377.                 (choices
  378.                     "Yes"
  379.                     "No"
  380.                 )
  381.                 (default 1)
  382.             )
  383.         )
  384.         (if (= #result 1)
  385.             (
  386.                 (set #destdoc (askdir
  387.                         (prompt "Select the place to install the documentation. A drawer \"docs\" will be created.")
  388.                         (help @askdir-help)
  389.                         (newpath)
  390.                         (default "HELP:")
  391.                     )
  392.                 )
  393.                 (copyfiles
  394.                     (prompt "Copying documentation files")
  395.                     (help @copyfiles-help)
  396.                     (source "Docs")
  397.                     (infos)
  398.                     (all)
  399.                     (dest (tackon #destdoc "Docs"))
  400.                 )
  401.             )
  402.         )
  403.  
  404.         (exit)
  405.     )
  406.  
  407.     ; uninstall application
  408.  
  409.     (
  410.         ; --- insert your code below ---
  411.         (delete "libs:Warp3D.library" (optional "force"))
  412.         (delete "libs:Warp3DPPC.library" (optional "force"))
  413.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  414.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  415.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  416.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  417.         (delete "libs:Warp3D/" (optional "force"))
  418.         ; -- end of your code ---
  419.  
  420.         (message "Uninstallation completed. The demo and documentation must be deleted manually.")
  421.  
  422.         (exit (quiet))
  423.     )
  424. )
  425.  
  426.